package com.ndp.fb.scheduler.job;

import com.ndp.fb.constant.ConfigConst;
import com.ndp.fb.scheduler.annotation.CronScheduled;
import com.ndp.fb.scheduler.annotation.ScheduleLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by hunk.qin on 2015/7/18.
 */
@Component
public class DaemonJob {

    private static Logger logger = LoggerFactory.getLogger(DaemonJob.class);

    @Autowired
    private ScheduleLock scheduleLock;

    @CronScheduled(cronkey = ConfigConst.SCHEDULE_DAEMON_CRON,enablekey ="true")
    public void  deamonjob() {
        logger.info("===deamonjob====");
        scheduleLock.daemon();
    }
}
